package com.deepakchandwani.main;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.deepakchandwani.university.Student;
import com.deepakchandwani.university.Teacher;
import com.deepakchandwani.util.HibernateUtil;

public class TPCCWithUnionTesterModified {

	public static void main(String[] args) {
		Student student = new Student();
		Student student1 = new Student();
		
		Teacher teacher = new Teacher();

		student.setName("Saurabh");
		student.setYear(2);
		student.setDepartment("CSE");

		student1.setName("Anu");
		student1.setYear(3);
		student1.setDepartment("CSE");
		
		teacher.setExperience(4);
		teacher.setName("Priyanka");
		teacher.setSpecialization("Java");
		teacher.setDepartment("CSE");

		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		Transaction transaction = session.beginTransaction();
		session.save(student);
		session.save(student1);
		
		session.save(teacher);
		transaction.commit();
	}

}
